﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using XNALibrary;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Netpong.Networking;
using FarseerGames.FarseerPhysics;
using FarseerGames.GettingStarted.ScreenSystem;
using Microsoft.Xna.Framework.Content;

namespace NetPong.PongClasses2d
{
    public class Ball2d : Ball
    {
        Texture2D ballTexture;

        public Ball2d(NetworkManager nm, Vector2 pos, int rad, PhysicsSimulator ps, ContentManager cm)
            : base(nm, pos, rad, ps)
        {
            ballTexture = cm.Load<Texture2D>("Content/Ball");
            ballOrigin = new Vector2(ballTexture.Width / 2f, ballTexture.Height / 2f);
        }

        public override void RenderDefault(RenderControl rc, GameTime gt)
        {
            rc.SpriteBatch.Begin(SpriteBlendMode.AlphaBlend);
            rc.SpriteBatch.Draw(ballTexture, this.geom.Position, null, Color.White,
                                           this.geom.Rotation * 500, ballOrigin, 1, SpriteEffects.None, 0);
            rc.SpriteBatch.End();
        }

        public override void RenderAnimation(RenderControl rc, GameTime gt)
        {
            throw new NotImplementedException();
        }
    }
}
